import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import model.BasicParameter;

import org.junit.Test;

public class TestBasicParameter {

	@Test
	public void testBasicParameter() {
		BasicParameter basic = new BasicParameter();

		basic.setTimeOut(BasicParameter.NO_DELAY);
		assertFalse("set NO_DELAY return need timeout", basic.needTimeOut());

		basic.setTimeOut(BasicParameter.MIN_DELAY);
		assertTrue("min delay consider as no delay", basic.needTimeOut());

		assertEquals("return wrong value for timeout : " + basic.getTimeOut() + " instead of : "
				+ BasicParameter.MIN_DELAY, BasicParameter.MIN_DELAY, basic.getTimeOut());

		basic.setTimeOut(BasicParameter.MIN_DELAY - 1);
		assertFalse("basic check doesn't detect to low timeout", basic.basicCheck());

		assertEquals("return wrong value for timeout : " + basic.getTimeOut() + " instead of : "
				+ BasicParameter.MIN_DELAY, BasicParameter.MIN_DELAY - 1, basic.getTimeOut());

	}

}
